#include <json/json.h>
#include <iostream>
#include <string>

int main() {
    std::string strJson = R"({"Age": 20, "Name": "John"})"; // Raw string literal

    Json::Value root;   // 'root' will contain the root value after parsing.
    Json::Reader reader;

    bool parsingSuccessful = reader.parse(strJson, root); // parse process
    if (!parsingSuccessful) {
        std::cerr << "Failed to parse the JSON string" << std::endl;
        return 1;
    }

    const std::string name = root["Name"].asString();
    const int age = root["Age"].asInt();

    std::cout << "Name: " << name << std::endl;
    std::cout << "Age: " << age << std::endl;

    return 0;
}
